/*
 * Wire
 * Copyright (C) 2018 Wire Swiss GmbH
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 */

.conversation-input-bar {
  display: flex;
  box-sizing: content-box;
  width: 100%;
  min-height: @conversation-input-min-height;
  background-color: #fff;
  position: relative;
}

.conversation-input-bar-editing {
  background-color: fade(@w-yellow, 16%);
  transition: background-color @animation-timing-faster @ease-in-quad;
}

.conversation-input-bar-text {
  .accent-selection-color;
  .custom-scrollbar;
  .reset-textarea;
  background-color: transparent;
  flex: 1 1;
  line-height: @conversation-input-line-height;
  height: @conversation-input-line-height;
  margin-bottom: (@conversation-input-min-height - @conversation-input-line-height) / 2;
  margin-top: (@conversation-input-min-height - @conversation-input-line-height) / 2;
  min-height: @conversation-input-line-height;
  max-height: @conversation-input-max-height;
  max-width: @conversation-max-width - @conversation-message-sender-width - @conversation-message-timestamp-width;
  overflow: hidden;

  &::placeholder {
    .label-xs;
    color: fade(@graphite, 48%);
    padding-left: 8px;
  }

  &.ephemeral-input::placeholder {
    .accent-color();
  }
}

.controls-left {
  .flex-center;
  width: @conversation-message-sender-width;
  height: @conversation-input-min-height;
}

.controls-center {
  flex: 1 1;
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.controls-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: @conversation-message-timestamp-width;
}

.controls-right-button {
  position: relative;
  flex: 0 0 auto;
  margin-left: 12px;
  margin-right: 12px;
}

.conversation-input-bar-ephemeral {
  position: relative;
}

.controls-right-button-ephemeral-context {
  .square(32px);
  position: absolute;
  left: 0;
  top: 0;
  outline: 0;
}

.ephemeral-mode,
.bubble-menu .ephemeral-mode {
  .accent-color();
}

.ephemeral-timer-button {
  .circle(@avatar-diameter-xs);
  .accent-color();
  .accent-border-color(24%);
  position: relative;
  border-width: 1px;
  border-style: solid;
  font-size: @font-size-xs;
  font-weight: @font-weight-bold;
  line-height: @avatar-diameter-xs - 2;
  text-align: center;
  margin: 4px;
}

.ephemeral-timer-button-unit {
  .circle(16px);
  position: absolute;
  right: -8px;
  top: -2px;
  background-color: #fff;
  line-height: 14px;
}

// paste modal
@keyframes paste-fade-in {
  to {
    opacity: 1;
  }
}

.conversation-input-bar-paste-modal {
  .full-screen;
  display: flex;
  background-color: #fff;
  opacity: 0;
  animation-name: paste-fade-in;
  animation-duration: @animation-timing-slow;
  animation-timing-function: @ease-out-expo;
  animation-fill-mode: forwards;
}

.conversation-input-bar-paste-icon {
  color: @graphite;
  margin-right: 16px;
}

.conversation-input-bar-paste-image {
  .square(16px);
  object-fit: contain;
}

.conversation-input-bar-paste-send {
  .circle(32px);
  color: #fff;
  cursor: pointer;
  line-height: 32px;
  margin-right: 16px;
  text-align: center;
}

.conversation-input-bar-paste-cancel {
  margin-right: 32px;
}

.conversation-input-bar-emoji-list {
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.08), 0 8px 24px 0 rgba(0, 0, 0, 0.16);
  display: block;
  font-size: 12px;
  font-weight: @font-weight-regular;
  line-height: @line-height-xl;
  position: fixed;
  z-index: @z-index-context;

  .emoji {
    cursor: pointer;

    &:first-child {
      border-radius: 4px 4px 0 0; // to match parent's border-radius
    }

    &:last-child {
      border-radius: 0 0 4px 4px; // to match parent's border-radius
    }

    &.selected {
      background-color: fade(@graphite, 16%);
    }

    .symbol {
      display: inline-block;
      padding-left: 12px;
      font-size: @font-size-sm;
      text-align: center;
      vertical-align: middle;
      position: absolute;
    }

    .name {
      display: inline-block;
      padding-right: 16px;
      vertical-align: middle;
      margin-left: 40px;

      &::first-letter {
        text-transform: capitalize;
      }
    }
  }
}
